package com.qs.worklog.entity;

import java.util.Date;

public class Task implements Comparable<Task>{
	private int id;
	private int uid;
	private Date actionTime;
	private double timeCost;
	private String description;
	private String userName;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getUid() {
		return uid;
	}
	public void setUid(int uid) {
		this.uid = uid;
	}
	public Date getActionTime() {
		return actionTime;
	}
	public void setActionTime(Date actionTime) {
		this.actionTime = actionTime;
	}
	public double getTimeCost() {
		return timeCost;
	}
	public void setTimeCost(double timeCost) {
		this.timeCost = timeCost;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	@Override
	public int compareTo(Task o) {
		if(this.actionTime.equals(o.actionTime)){
			if(this.userName.equalsIgnoreCase(o.userName)){
				return new Integer(this.id).compareTo(o.id);
			}
			return this.userName.compareToIgnoreCase(o.userName);
		}
		return this.actionTime.compareTo(o.actionTime);
	}
}
